<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/12/5 0005
  Time: 上午 10:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>租车支付</title>
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/common.css">

</head>
<body>
<div class="wrap-padding-15">
    <form action="/aa" method="post" class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">客户手机:</label>
            <div class="layui-input-block">
                <input type="text" name="mobile" value="${clientUser.mobile}"  autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">订单号：</label>
            <div class="layui-input-block">
                <input type="text" name="orderid"  autocomplete="off" class="layui-input" value="${carOrder.orderid}">
            </div>
        </div>

        <div  class="layui-form-item ">
            <label class="layui-form-label">金额数：</label>
            <div class="layui-input-block">
                <input type="text" name="shouldtotal" value="${carOrder.shouldtotal}"    autocomplete="off" class="layui-input"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">支付方式：</label>
            <div class="layui-input-block">
                <select  lay-verify="required" name="payway" >
                    <option value="0">请选择支付方式</option>
                    <option value="1">信用卡</option>
                    <option value="2">银行卡</option>
                    <option value="3">支付宝</option>
                    <option value="4">微信</option>
                    <option value="5">现金</option>
                </select>
            </div>
        </div>

        <div  class="layui-form-item ">
            <label class="layui-form-label">实际支付：</label>
            <div class="layui-input-block">
                <input type="text" name="realtotal"  autocomplete="off" class="layui-input"/>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formSubmit">订单生成</button>
                <a href="/yurent"><button type="button" class="layui-btn layui-btn-primary">取消</button></a>
            </div>
        </div>
    </form>


</div>
<script src="/static/plugins/jquery.js"></script>
<script src="/static/plugins/layui/layui.js"></script>
<script>

    layui.use(['upload','laydate','element','layer','form'], function() {
        var $ = layui.jquery
            , upload = layui.upload
            , laydate = layui.laydate
            , form = layui.form
            , element = layui.element
            , layer = layui.layer;


        //监听提交
        form.on('submit(formSubmit)',function (data) {

            $.ajax({
                url:"/carOrder/updateOrderstate",
                type:"post",
                dataType:"json",
                data:{orderstate:2,orderid:data.field.orderid,payway:data.field.payway,realtotal:data.field.realtotal},
                success:function (rs) {
                    if(rs.code == 1){
                        layer.msg("定购成功",{time:1000,icon:1},function () {
                            location.href = "/carOrder/rentHistory"
                        })
                    }
                }
            })
            return false
        })

    })
</script>
</body>
</html>
